package com.example.myapplication.ui.fragment.collect

import androidx.lifecycle.ViewModel
import androidx.lifecycle.viewModelScope
import com.example.myapplication.request.CollectRequest
import kotlinx.coroutines.launch

/**
 *收藏网站
 *
 * @author : Kun
 * @date : 2021/6/8
 * @time : 10:01
 */
class WebsiteCollectViewModel : ViewModel() {
    /**
     * 收藏相关的请求
     */
    val collectRequest = CollectRequest()

    /**
     * 获取收藏网站列表
     */
    fun requestCollectWebsiteList() {
        viewModelScope.launch {
            collectRequest.requestWebsiteArticle()
        }
    }

    /**
     * 删除收藏网站
     */
    fun requestCollectWebsiteList(id:Int) {
        viewModelScope.launch {
            collectRequest.requestDeleteWebsite(id)
        }
    }
}